﻿<UserControl
    x:Class="WinRTXamlToolkit.Debugging.Views.DependencyObjectDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WinRTXamlToolkit.Debugging.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converters="using:WinRTXamlToolkit.Converters"
    xmlns:controls="using:WinRTXamlToolkit.Debugging.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    IsTabStop="False">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary
                    Source="ms-appx:///WinRTXamlToolkit.Debugging/Themes/SharedResources.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style
                x:Key="HorizontalScrollViewerStyle"
                TargetType="ScrollViewer">
                <Setter
                    Property="HorizontalScrollBarVisibility"
                    Value="Auto" />
                <Setter
                    Property="VerticalScrollBarVisibility"
                    Value="Disabled" />
                <Setter
                    Property="ScrollViewer.HorizontalScrollMode"
                    Value="Enabled" />
                <Setter
                    Property="ScrollViewer.VerticalScrollMode"
                    Value="Disabled" />
                <Setter
                    Property="ScrollViewer.ZoomMode"
                    Value="Disabled" />
            </Style>

            <Style
                x:Key="VerticalScrollViewerStyle"
                TargetType="ScrollViewer">
                <Setter
                    Property="HorizontalScrollBarVisibility"
                    Value="Disabled" />
                <Setter
                    Property="VerticalScrollBarVisibility"
                    Value="Auto" />
                <Setter
                    Property="ScrollViewer.HorizontalScrollMode"
                    Value="Disabled" />
                <Setter
                    Property="ScrollViewer.VerticalScrollMode"
                    Value="Enabled" />
                <Setter
                    Property="ScrollViewer.ZoomMode"
                    Value="Disabled" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid
        HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition
                Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel
            Orientation="Horizontal"
            VerticalAlignment="Bottom"
            Margin="0,0,0,0">
            <RadioButton
                x:Name="PropertiesTabButton"
                Content="Properties"
                Style="{StaticResource TabButtonStyle}"
                IsChecked="True" />
            <RadioButton
                x:Name="DetailsTabButton"
                Content="Details"
                Style="{StaticResource TabButtonStyle}" />
            <!--<RadioButton
                x:Name="PreviewTabButton"
                Content="Preview"
                Checked="PreviewTabButton_OnChecked"
                IsChecked="{Binding TreeModel.IsPreviewShown, Mode=TwoWay}"
                Style="{StaticResource TabButtonStyle}" />-->
        </StackPanel>
        <local:PropertiesView
            x:Name="PropertiesView"
            Grid.Row="1"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Visibility="{Binding IsChecked, ElementName=PropertiesTabButton, Converter={StaticResource BooleanToVisibilityConverter}}">
        </local:PropertiesView>
        <ScrollViewer
            x:Name="DetailsView"
            Visibility="{Binding IsChecked, ElementName=DetailsTabButton, Converter={StaticResource BooleanToVisibilityConverter}}"
            Grid.Row="1"
            Style="{StaticResource VerticalScrollViewerStyle}">
            <ItemsControl
                ItemsSource="{Binding Details}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock
                                Text="{Binding Label}"
                                FontSize="12"
                                FontWeight="Bold"
                                TextWrapping="Wrap" />
                            <TextBlock
                                Text="{Binding Detail}"
                                TextWrapping="Wrap"
                                Margin="0,0,0,10" />
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
        <!--<ScrollViewer
            x:Name="PreviewView"
            Visibility="{Binding IsChecked, ElementName=PreviewTabButton, Converter={StaticResource BooleanToVisibilityConverter}}"
            Grid.Row="1"
            ZoomMode="Enabled"
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto"
            VerticalScrollMode="Auto"
            HorizontalScrollMode="Auto"
            VerticalAlignment="Stretch"
            HorizontalAlignment="Stretch">
            <Image
                Source="{Binding PreviewImageSource}"/>
        </ScrollViewer>-->
    </Grid>
</UserControl>
